package cn.pzaily.orange.manage.controller;

import cn.pzaily.orange.core.utils.http.ResponseResult;
import cn.pzaily.orange.manage.model.SysMenu;
import cn.pzaily.orange.manage.model.vo.SysMenuTreeNode;
import cn.pzaily.orange.manage.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @PackageName: cn.pzaily.orange.manage.controller
 * @Description:
 * @Author: Pang
 * @Date: 2021-05-24 22:48
 */
@RestController
@RequestMapping(value = "/menu")
public class SysMenuController {

    @Autowired
    private SysMenuService menuService;

    @RequestMapping(value = "/findNavTree", method = RequestMethod.POST)
    public ResponseResult findNavTree(@RequestParam(value = "username") String userName) {
        List<SysMenuTreeNode> menus = menuService.findTree(userName, 1);
        return ResponseResult.okResult(menus);
    }

}
